package com.jims.api.v1.controller.common;

import com.jims.master.common.data.Message;
import com.jims.master.common.utils.*;
import com.jims.master.modules.doctor.area.entity.SysArea;
import com.jims.master.modules.doctor.area.service.SysAreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 地域信息
 * @author jict
 * @version 2017-11-21
 */
@RestController
@RequestMapping(value = "area")
public class AreaController {
    @Autowired
    private SysAreaService sysAreaService;

    /**
     * @Title:
     * @Description: （省市区三级联动）
     * @param code 城市code值
     * @return
     * @author jict
     * @date 2017/11/22
     * @throws
     */
    @RequestMapping(value = "V100/getArea",method ={RequestMethod.GET,RequestMethod.POST})
    public String getArea(@RequestParam(required=true) String code) {
        Message msg=new Message();
        List<SysArea> list = sysAreaService.getArea(code);
        msg.setData(list);
        return SecurityUtil.encryptMsgData(msg);
    }

}
